Flows Overview
Flow blocks
Flows consist of flow blocks, which serve a specific purpose. For instance:
- Generate document
- Store in SharePoint
When running the flow, Smart Flows will go through every block (from top to bottom) and do whatever that block is intended for.
For instance, the following flow has 5 blocks spread out over 4 zones:
The Generate document block is colored because it is the selected block.
Notice that the Print and Generate document block are on the same 'level' - this is called a flow zone. So this flow has 5 blocks spread out over 4 zones.
Caution If a flow is started outside of Microsoft Dynamics, the system cannot maintain the identities when using impersonation. When the flow runs, it will run with the person's credentials who created the connectors. This will show that the connector creator performed subsequent actions during the f low execution instead of the person who is running the flow.
Flow block categories
A flow block covers one specific purpose, such as Generate document, Print, E-mail, Save to file etc.
Blocks are divided into 5 categories:
- Input - to define where your flow gets the data it needs.
- Document - to generate or convert a document, or set its properties.
- Output - to do something with the generated document.
- Controls - to change how your flow goes through the blocks, such as making certain parts conditional.
- General - for blocks that don't belong anywhere else.
Depending on your connectors/project, you can have other categories as well:
- Dynamics - all Dynamics-related blocks such as Create note.
- Custom - for custom-made blocks.
Linked flow blocks
The key to building a working flow is linking blocks together. This is achieved by matching one block's output to another's input.
For instance, take a look at the following screenshot:
The Generate document block's output is a document, which is the input for both the Create note and Print blocks. So you can link the both the Create note and Print blocks to the Generate document block.
Flow blocks are colored yellow if they're linked to the currently selected block.
How to link blocks is explained here.
Flow zones
A flow zone is a container for flow blocks. Every block in a zone is executed simultaneously (or their order is unknown, depending on how long certain things take) and when every block is finished executing, the flow continues with the blocks in the next zone.
In the following screenshot, we see an empty zone followed by a zone with 2 blocks in it:
In the simple flow builder, zones work differently.
Locked flow zones
Some zones are locked, meaning that you cannot add blocks or remove blocks from it. This is made clear by the striped background:
Locked flow zones are reserved for blocks that have to be executed.
Flow rule
The general rule of flows is that you can only link blocks that are in different zones.
For instance, let's look at the following screenshot.
There are several links here:
- Generate document gets its data from Get user input.
- Create note converts the document from Generate document.
- Print prints the document from Generate document.
The Save to file block cannot be linked to the currently selected Generate document block since they are in the same zone. You can select and drag it to a zone below it - you can then link it to the Generate document block.
Keep this rule in mind when designing your flows.
Primary template & primary entity
Flows were designed to always generate at least one document. Smart Flows is about document generation, after all. This is why there's a locked zone with a Generate document block in every flow:
Since a document has to be generated, a template has to be used. This template is called the primary template. If that template data set attached to it, one of those data sets is the primary data set. For instance:
- The Account profile template uses the Account, Contact and Ask info data sets.
- The Account data set is a standard data set that describes CRM data from an Account record.
- The Contact data set is a standard data set that describes CRM data from a Contact record.
- The Ask info data set is a custom data set with a few user questions.
When you want to create a flow based on this template, you'll see this window:
Smart Flows realizes that there can be a conflict: will your end users run this flow from the account or contact entity? In most cases, such conflicts won't occur but if they do, Smart Flows is there to ask you what the primary entity is.
Flow starting points
There are 3 kinds of flows, depending on their starting point:
- Flows that end users run from a CRM system, such as Dynamics or Sugar. Or the system runs the flows in the background, such as workflows (in Dynamics).
- Flows that end users run from your own software, when you are using Smart Flows to build document generation into your own software.
- Flows that end users run from the Smart Flows Project Console.
The starting point of a flow is determined automatically by the flow builder upon creation of a flow. The primary template of the flow is enough to determine the starting point of a flow:
- If the primary template has a standard data set attached to it, the flow can only be started from within a CRM system (which CRM system is determined by your connectors).
- If the primary template has a schema data set attached to it, the flow can only be started from your own software.
- If the primary template only has a custom data set attached to it, the flow can only be started from within the Smart Flows project console.
Typically, you'll only either use standard or schema data sets, depending on whether you use Smart Flows with a CRM system or with your own software.